function AllReady() {
    var mstform = Ext.getCmp('entpriseform');
    var tabPanel = Ext.ComponentQuery.query('tabpanel')[0];
    const toolbar = Ext.ComponentQuery.query('ngToolbar')[1]
    addTabs(mstform, tabPanel, toolbar);
	let reqLock = true
// 加载框
createLoading()
function createLoading() {
  const style = document.createElement('style');
  style.innerHTML = `
  .loading-mask {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8); display: none; justify-content: center; align-items: center; z-index: 9999;
  }
  .loading-spinner {
    width: 60px; height: 60px;
    border: 6px solid #ccc; border-top-color: #1d72b8;
    border-radius: 50%; animation: spin 1s linear infinite;
  }
  @keyframes spin {
    to { transform: rotate(360deg); }
  }`;
  document.head.appendChild(style);

  const mask = document.createElement('div');
  mask.className = 'loading-mask';
  mask.innerHTML = `<div class="loading-spinner"></div>`;
  document.body.appendChild(mask);

  window.zshowLoading = () => mask.style.display = 'flex';
  window.zhideLoading = () => mask.style.display = 'none';
}
    toolbar.insert(22,{
        xtype: "button",
        text: "查询/刷新MDG供应商信息",
    
        id: "pushBtn",
        iconCls: "icon-New",
        handler: function () {
          try{
            window.zshowLoading()
            if(!reqLock) return false
          	reqLock = false
            console.log("请求中")
          // 按钮点击后执行的逻辑，发送 AJAX 请求
          var CompName = mstform.getItem("CompName").getValue(); // 假设 phid 存在于表单中
    
          // 拼接查询参数
        //   var baseUrl = "https://inner-apisix.hisense.com/sd/common/sd/common/sdToMdg/supply/queryMdgSupply?user_key=pxgy9hyt9udfgfcsbzizykw0xfqi6uk6"
          var baseUrl = "http://nginx.clouddev.hisense.com/sd/sdToMdg/supply/queryMdgSupply";
          var encodedName = encodeURIComponent(CompName); // 编码特殊字符
          var urlWithParams = baseUrl + "?comname=" + encodedName;
            if(!CompName){
                Ext.Msg.alert("错误", "请输入客户名称");
                reqLock = true;
                return
            }
          // 使用 GET 请求
          Ext.Ajax.request({
            url: urlWithParams,
            headers:{"Content-Type":"application/json"},
            jsonData:{
                customerName:CompName
            },
            method: "POST",
            success: function (response) {
              var res = Ext.decode(response.responseText);
              console.log(`推送客户数据响应体`,res);
              if (res.IsOk) {
                Ext.Msg.alert("提示", res.data);
              } else {
                Ext.Msg.alert("错误", res.data);
              }
              reqLock = true
            },
            failure: function () {
              Ext.Msg.alert("错误", "请求失败，请稍后再试");
              reqLock = true
            },
          });
          }catch(e){
            Ext.Msg.alert("发生错误",e)
            reqLock = true
          } finally{
            window.zhideLoading()
          }
        },
      });
    mstform.getItem('user_dwxz').addListener("change", function () {
        changeBt()
    });
    mstform.getItem('user_sj_zj').addListener("change", function () {
        changeBt()
    });
    mstform.getItem('RegMoney').addListener("change", function () {
        changeBt()
    });
    function changeBt(params) {
          // 获取当前 dwxz 的值（转换为数字）
          const dwxz = parseInt(mstform.getItem('user_dwxz').getValue(), 10);
          // 获取关联字段的值
          const userSjZj = mstform.getItem('user_sj_zj').getValue();
          const regMoney = mstform.getItem('RegMoney').getValue();
  
          // 条件优先级：先检查最严格的条件3
          if ([10, 20, 30, 40].includes(dwxz)) {
              if (userSjZj || regMoney) { // 检查字段是否非空
                  console.log(3);
                  mstform.getItem('user_mrjybz').userSetMustInput(true);
              } else {
                  mstform.getItem('user_mrjybz').userSetMustInput(false);
              }
              console.log(1);
              mstform.getItem('RegDt').userSetMustInput(true);
              mstform.getItem('user_sj_zj').userSetMustInput(true);
              mstform.getItem('RegMoney').userSetMustInput(true);
              mstform.getItem('user_ndyysrgm').userSetMustInput(true);
              mstform.getItem('user_zyywhy').userSetMustInput(true);
          } else {
              mstform.getItem('RegDt').userSetMustInput(false);
              mstform.getItem('user_sj_zj').userSetMustInput(false);
              mstform.getItem('RegMoney').userSetMustInput(false);
              mstform.getItem('user_ndyysrgm').userSetMustInput(false);
              mstform.getItem('user_zyywhy').userSetMustInput(false);
              mstform.getItem('user_mrjybz').userSetMustInput(false);
          }
  
          if ([10, 20, 30, 40, 50].includes(dwxz)) {
              console.log(2);
              mstform.getItem('user_qqghnl').userSetMustInput(true);
              mstform.getItem('user_ygrs').userSetMustInput(true);
          } else {
              mstform.getItem('user_qqghnl').userSetMustInput(false);
              mstform.getItem('user_ygrs').userSetMustInput(false);
          }
          if (!dwxz || dwxz == 70) {
            mstform.getItem('TaxNo').userSetMustInput(false);
          }else{
            mstform.getItem('TaxNo').userSetMustInput(true);
          }
    }

}
//------生成主键函数(格式为日期时间毫秒+流水号)------
function generateId(sequence) {
    //获取当前时间
    const date = new Date();
    // 格式化日期为 YYMMDD
    const year = date.getFullYear().toString().slice(-2);
    const month = (date.getMonth() + 1).toString().padStart(2, '0');
    const day = date.getDate().toString().padStart(2, '0');
    const dateStr = `${year}${month}${day}`;
    // 格式化时间为 HHMMSS
    const hours = date.getHours().toString().padStart(2, '0');
    const minutes = date.getMinutes().toString().padStart(2, '0');
    const seconds = date.getSeconds().toString().padStart(2, '0');
    const timeStr = `${hours}${minutes}${seconds}`;
    // 获取毫秒数，并确保是2位数
    const milliseconds = date.getMilliseconds().toString().padStart(3, '0').slice(0, 2);
    // 格式化流水号为3位
    const sequenceStr = sequence.toString().padStart(3, '0');
    // 拼接日期、时间、毫秒和流水号
    const phid = `${dateStr}${timeStr}${milliseconds}${sequenceStr}`;
    return phid;
}

//增加表头tab页
function addTabs(mstform, tabPanel, toolbar) {

    //定义model
    var supply_info_model = Ext.define('JdNextPlanmodel', {
        extend: 'Ext.data.Model',
        fields: [{
            name: 'phid',
            type: 'bigInt',
            mapping: 'phid'
        },
        {
            name: 'mstphid',
            type: 'bigInt',
            mapping: 'mstphid'
        },
        {
            name: 'supply_ex_type1',
            type: 'string',
            mapping: 'supply_ex_type1'
        },
        {
            name: 'supply_ex_type1_exname',
            type: 'string',
            mapping: 'supply_ex_type1_exname'
        },
        {
            name: 'supply_no',
            type: 'string',
            mapping: 'supply_no'
        },
        {
            name: 'relate_type',
            type: 'string',
            mapping: 'relate_type'
        },
        {
            name: 'relate',
            type: 'string',
            mapping: 'relate'
        },
        {
            name: 'relate_gx_type',
            type: 'string',
            mapping: 'relate_gx_type'
        },
        {
            name: 'bu_partner_role',
            type: 'string',
            mapping: 'bu_partner_role'
        },
        {
            name: 'sap_client',
            type: 'string',
            mapping: 'sap_client'
        },
        {
            name: 'old_no',
            type: 'string',
            mapping: 'old_no'
        },
        {
            name: 'supply_account_group',
            type: 'string',
            mapping: 'supply_account_group'
        },
        {
            name: 'tax_type',
            type: 'string',
            mapping: 'tax_type'
        }, {
            name: 'tax_no',
            type: 'string',
            mapping: 'tax_no'
        },
        ]
    });

    //定义store
    var supply_info_store = Ext.create('Ext.ng.JsonStore', {
        model: supply_info_model
    });
    //供应商关联信息 grid  
    var supply_info = Ext.create('Ext.ng.GridPanel', {
        title: '供应商关联信息',
        id: 'supply_info',
        region: 'south',
        stateful: false,
        isInit: true,
        MaxHeight: 800,
        stateId: 'supply_info', //所有单据不允许重复
        store: supply_info_store,
        buskey: 'phid', //对应的业务表主键属性
        otype: otype,
        columnLines: true,
        tbar: [{
            xtype: 'button',
            itemId: 'addrow',
            text: '增行',
            iconCls: "icon-AddRow",
            handler: function () {
                var newRecord = {
                    'phid': generateId(supply_info_store.getCount() + 1).toString(),
                    // 可以在这里添加其他初始字段
                };
                supply_info_store.insert(supply_info_store.getCount(), [newRecord]);
            }
        }, {
            xtype: 'button',
            itemId: 'delrow',
            text: '删行',
            iconCls: "icon-DeleteRow",
            handler: function () {
                var data = supply_info.getSelectionModel().getSelection();
                Ext.Array.each(data, function (record) {
                    supply_info_store.remove(record);
                });
            }
        }
        ],
        columns: [Ext.create('Ext.grid.RowNumberer', { text: '序号', width: 45 }),
        {
            header: Lang.fg3_enterprise_phid || '主键',
            dataIndex: 'phid',
            itemId: 'phid',
            width: 100,
            sortable: true,
            hidden: true
        },
        {
            header: Lang.fg3_enterprise_phid || '单据主键',
            dataIndex: 'mstphid',
            itemId: 'mstphid',
            width: 100,
            sortable: true,
            hidden: true,
            readOnly: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '类型phid',
            dataIndex: 'supply_ex_type1',
            itemId: 'supply_ex_type1',
            readOnly: false,
            width: 100,
            sortable: true,
            hidden: true
        }, {
            header: '类型',
            dataIndex: 'supply_ex_type1_exname',
            width: 100,
            sortable: true,
            readOnly: false,
            mustInput: false,
            hidden: false,
            editor: {
                xtype: 'ngRichHelp',
                valueField: 'phid',
                displayField: 'c_name',
                listFields: 'c_no,c_name,phid',
                listHeadTexts: '编码,名称',
                helpid: 'supply_ex_type1',
                needBlankLine: true,
                isInGrid: true,
                ORMMode: false,
                emptyText: '',
                mustInput: false,
                listeners: {
                    helpselected: function (obj) {
                        var data = supply_info.getSelectionModel().getSelection();
                        var oriValue = data[0].get('supply_ex_type1');
                        data[0].set('supply_ex_type1', obj.code);
                        data[0].set('supply_ex_type1_exname', obj.name);
                        var e = {};
                        e.field = 'supply_ex_type1';
                        e.value = data[0].get('supply_ex_type1');
                        e.originalValue = oriValue;
                        e.record = data[0];
                        supply_info.getCellEditing().fireEvent('edit', supply_info.getCellEditing(), e);
                    }
                }
            },
            renderer: function (val, m) {
                if (Ext.isObject(m)) {
                    m.style = "color:rgb(0,0,255);background-color:";
                }
                return val;
            }
            //, locked: true
        }, {
            header: '供应商编码',
            dataIndex: 'supply_no',
            itemId: 'supply_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },

        {
            header: '关联方类型',
            dataIndex: 'relate_type',
            itemId: 'relate_type',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '关联方',
            dataIndex: 'relate',
            itemId: 'relate',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '关联关系类型',
            dataIndex: 'relate_gx_type',
            itemId: 'relate_gx_type',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '业务伙伴角色',
            dataIndex: 'bu_partner_role',
            itemId: 'bu_partner_role',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: 'Sap Client',
            dataIndex: 'Sap_Client',
            itemId: 'Sap_Client',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '旧编码',
            dataIndex: 'old_no',
            itemId: 'old_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '供应商科目组',
            dataIndex: 'Supply_account_group',
            itemId: 'Supply_account_group',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '税类型',
            dataIndex: 'tax_type',
            itemId: 'tax_type',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '税号',
            dataIndex: 'tax_no',
            itemId: 'tax_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },


        ],
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ]
    });
    //加到tab
    tabPanel.add(supply_info);






    //提示
    // // cnt_extend_grid.addDocked({ dock: 'top', xtype: 'label', html: '<span style="color:red;"> 温馨提示：<br/> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 此页签数据从合同补充协议动态获取，无需填报。 </span>' });
    // //自定义增行
    // var btn_add = Ext.create('Ext.button.Button', {
    //     itemId: 'addrow_new',
    //     text: '供应商关联信息增行',
    //     iconCls: "iconfont iconinsert-row",
    //     handler: function () { }
    // });
    // //加到工具栏
    // toolbar.insert(8, btn_add); //插入到第2个按钮前，从序号从0开始
    // let supply_infoStore = supply_info.getStore();
    // btn_add.on('click', function () {
    //     supply_infoStore.add({
    //         'phid': generateId(supply_infoStore.getCount() + 1).toString()
    //     });
    // });

    // //自定义删行
    // var btn_del = Ext.create('Ext.button.Button', {
    //     itemId: 'deleterow_new',
    //     text: '供应商关联信息删行',
    //     iconCls: "iconfont icondelete-row",
    //     handler: function () { }
    // });
    // //加到工具栏  
    // toolbar.insert(9, btn_del); //插入到第3个按钮前，从序号从0开始
    // btn_del.on('click', function () {
    //     let dataSelect = supply_info.getSelectionModel().getSelection();
    //     supply_infoStore.remove(dataSelect);
    // });

    // if (otype == 'view') {
    //     toolbar.get('addrow_new').setVisible(false);
    //     toolbar.get('deleterow_new').setVisible(false)
    // }
    //初始时，按钮不可见
    //  toolbar.get('addrow_new').setVisible(false);
    // toolbar.get('deleterow_new').setVisible(false)



    var supply_other_info_model = Ext.define('JdNextPlanmodel', {
        extend: 'Ext.data.Model',
        fields: [{
            name: 'phid',
            type: 'bigInt',
            mapping: 'phid'
        }, {
            name: 'mstphid',
            type: 'bigInt',
            mapping: 'mstphid'
        },
        {
            name: 'supply_ex_type2',
            type: 'string',
            mapping: 'supply_ex_type2'
        },
        {
            name: 'mdg_no',
            type: 'string',
            mapping: 'mdg_no'
        }, {
            name: 'sap_no',
            type: 'string',
            mapping: 'sap_no'
        }, {
            name: 'cgzz',
            type: 'string',
            mapping: 'cgzz'
        }, {
            name: 'fktj_no',
            type: 'string',
            mapping: 'fktj_no'
        }, {
            name: 'cg_order_hb',
            type: 'string',
            mapping: 'cg_order_hb'
        }, {
            name: 'incoterms_part1',
            type: 'string',
            mapping: 'incoterms_part1'
        },
        {
            name: 'incoterms_part2',
            type: 'string',
            mapping: 'incoterms_part2'
        }, {
            name: 'cgdj',
            type: 'string',
            mapping: 'cgdj'
        }, {
            name: 'cgdj_reason',
            type: 'string',
            mapping: 'cgdj_reason'
        }, {
            name: 'dj_dt',
            type: 'string',
            mapping: 'dj_dt'
        },
        {
            name: 'dj_process',
            type: 'string',
            mapping: 'dj_process'
        },
        {
            name: 'auto_cgdd',
            type: 'string',
            mapping: 'auto_cgdd'
        },
        {
            name: 'qr_control',
            type: 'string',
            mapping: 'qr_control'
        },
        {
            name: 'fpyz',
            type: 'string',
            mapping: 'fpyz'
        }, {
            name: 'factory',
            type: 'string',
            mapping: 'factory'
        }, {
            name: 'ent_no',
            type: 'string',
            mapping: 'ent_no'
        }, {
            name: 'account',
            type: 'string',
            mapping: 'account'
        }, {
            name: 'fkfsqd',
            type: 'string',
            mapping: 'fkfsqd'
        }, {
            name: 'ent_gzdj',
            type: 'string',
            mapping: 'ent_gzdj'
        }, {
            name: 'gzdj_reason',
            type: 'string',
            mapping: 'gzdj_reason'
        }, {
            name: 'fkdj_no',
            type: 'string',
            mapping: 'fkdj_no'
        },
        {
            name: 'fkdj_reason',
            type: 'string',
            mapping: 'fkdj_reason'
        },
        {
            name: 'sfqs',
            type: 'string',
            mapping: 'sfqs'
        },
        {
            name: 'xh',
            type: 'string',
            mapping: 'xh'
        },
        {
            name: 'plan_group',
            type: 'string',
            mapping: 'plan_group'
        },
        {
            name: 'scfpzt',
            type: 'string',
            mapping: 'scfpzt'
        },
        {
            name: 'remarks',
            type: 'string',
            mapping: 'remarks'
        },
        {
            name: 'sfxyht',
            type: 'string',
            mapping: 'sfxyht'
        }, {
            name: 'sbfk_dt',
            type: 'string',
            mapping: 'sbfk_dt'
        },
        {
            name: 'sbclfs',
            type: 'string',
            mapping: 'sbclfs'
        },
        {
            name: 'zzsfpxe',
            type: 'string',
            mapping: 'zzsfpxe'
        },
        {
            name: 'sfysfk',
            type: 'string',
            mapping: 'sfysfk'
        },
        {
            name: 'jcylzd',
            type: 'string',
            mapping: 'jcylzd'
        },
        {
            name: 'ddjsylzd',
            type: 'string',
            mapping: 'ddjsylzd'
        },
        {
            name: 'zgpl',
            type: 'string',
            mapping: 'zgpl'
        },
        {
            name: 'rzywlb',
            type: 'string',
            mapping: 'rzywlb'
        },
        {
            name: 'rzcpx',
            type: 'string',
            mapping: 'rzcpx'
        },
        {
            name: 'gh_stat',
            type: 'string',
            mapping: 'gh_stat'
        },
        {
            name: 'supply_attribute',
            type: 'string',
            mapping: 'supply_attribute'
        },
        {
            name: 'ycsupply_no',
            type: 'string',
            mapping: 'ycsupply_no'
        },
        {
            name: 'partner_gn',
            type: 'string',
            mapping: 'partner_gn'
        },
        {
            name: 'yw_partner_js',
            type: 'string',
            mapping: 'yw_partner_js'
        },
        {
            name: 'other_supply',
            type: 'string',
            mapping: 'other_supply'
        },
        {
            name: 'default_partner',
            type: 'string',
            mapping: 'default_partner'
        },

        ]
    });

    //定义store
    var supply_other_info_store = Ext.create('Ext.ng.JsonStore', {
        model: supply_other_info_model
    });
    //供应商其他信息 grid  
    var supply_other_info = Ext.create('Ext.ng.GridPanel', {
        title: '供应商其他信息',
        id: 'supply_other_info',
        region: 'south',
        stateful: false,
        isInit: true,
        MaxHeight: 800,
        stateId: 'supply_other_info', //所有单据不允许重复
        store: supply_other_info_store,
        buskey: 'phid', //对应的业务表主键属性
        otype: otype,
        columnLines: true,
        tbar: [{
            xtype: 'button',
            itemId: 'addrow',
            text: '增行',
            iconCls: "icon-AddRow",
            handler: function () {
                var newRecord = {
                    'phid': generateId(supply_other_info_store.getCount() + 1).toString(),
                    // 可以在这里添加其他初始字段
                };
                supply_other_info_store.insert(supply_other_info_store.getCount(), [newRecord]);
            }
        }, {
            xtype: 'button',
            itemId: 'delrow',
            text: '删行',
            iconCls: "icon-DeleteRow",
            handler: function () {
                var data = supply_other_info.getSelectionModel().getSelection();
                Ext.Array.each(data, function (record) {
                    supply_other_info_store.remove(record);
                });
            }
        }
        ],
        columns: [Ext.create('Ext.grid.RowNumberer', { text: '序号', width: 45 }),
        {
            header: Lang.fg3_enterprise_phid || '主键',
            dataIndex: 'phid',
            itemId: 'phid',
            width: 100,
            sortable: true,
            hidden: true
        },
        {
            header: Lang.fg3_enterprise_phid || '单据主键',
            dataIndex: 'mstphid',
            itemId: 'mstphid',
            width: 100,
            sortable: true,
            hidden: true,
            readOnly: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '类型phid',
            dataIndex: 'supply_ex_type2',
            itemId: 'supply_ex_type2',
            readOnly: false,
            width: 100,
            sortable: true,
            hidden: true
        }, {
            header: '类型',
            dataIndex: 'supply_ex_type2_exname',
            width: 100,
            sortable: true,
            readOnly: false,
            mustInput: false,
            hidden: false,
            editor: {
                xtype: 'ngRichHelp',
                valueField: 'phid',
                displayField: 'c_name',
                listFields: 'c_no,c_name,phid',
                listHeadTexts: '编码,名称',
                helpid: 'supply_ex_type2',
                needBlankLine: true,
                isInGrid: true,
                ORMMode: false,
                emptyText: '',
                mustInput: false,
                listeners: {
                    helpselected: function (obj) {
                        var data = supply_other_info.getSelectionModel().getSelection();
                        var oriValue = data[0].get('supply_ex_type2');
                        data[0].set('supply_ex_type2', obj.code);
                        data[0].set('supply_ex_type2_exname', obj.name);
                        var e = {};
                        e.field = 'supply_ex_type2';
                        e.value = data[0].get('supply_ex_type2');
                        e.originalValue = oriValue;
                        e.record = data[0];
                        supply_other_info.getCellEditing().fireEvent('edit', supply_other_info.getCellEditing(), e);
                    }
                }
            },
            renderer: function (val, m) {
                if (Ext.isObject(m)) {
                    m.style = "color:rgb(0,0,255);background-color:";
                }
                return val;
            }
            //, locked: true
        },
        {
            header: '供应商MDG编码',
            dataIndex: 'mdg_no',
            itemId: 'mdg_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '供应商SAP编码',
            dataIndex: 'sap_no',
            itemId: 'sap_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '采购组织',
            dataIndex: 'cgzz',
            itemId: 'cgzz',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '付款条件代码',
            dataIndex: 'fktj_no',
            itemId: 'fktj_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '采购订单货币',
            dataIndex: 'cg_order_hb',
            itemId: 'cg_order_hb',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '国际贸易条款（第 1 部分）',
            dataIndex: 'incoterms_part1',
            itemId: 'incoterms_part1',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '国际贸易条款（第 2 部分）',
            dataIndex: 'incoterms_part2',
            itemId: 'incoterms_part2',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '采购冻结在采购组织层',
            dataIndex: 'cgdj',
            itemId: 'cgdj',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '采购冻结原因',
            dataIndex: 'cgdj_reason',
            itemId: 'cgdj_reason',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '价格确定（定价）日期控制',
            dataIndex: 'dj_dt',
            itemId: 'dj_dt',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngDateTime',
                allowBlank: true
            }
        },
        {
            header: '定价过程',
            dataIndex: 'jd_process',
            itemId: 'jd_process',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '自动产生允许的采购订单',
            dataIndex: 'auto_cgdd',
            itemId: 'auto_cgdd',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '确认控制',
            dataIndex: 'qr_control',
            itemId: 'qr_control',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '标识：基于收货的发票验证',
            dataIndex: 'fpyz',
            itemId: 'fpyz',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '分公司',
            dataIndex: 'fgs',
            itemId: 'fgs',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '工厂',
            dataIndex: 'factory',
            itemId: 'factory',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '公司代码',
            dataIndex: 'ent_no',
            itemId: 'ent_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '总账科目',
            dataIndex: 'account',
            itemId: 'account',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '考虑的付款方式清单',
            dataIndex: 'fkfsqd',
            itemId: 'fkfsqd',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '对公司代码过帐冻结',
            dataIndex: 'ent_gzdj',
            itemId: 'ent_gzdj',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '过账冻结原因',
            dataIndex: 'gzdj_reason',
            itemId: 'gzdj_reason',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '付款冻结代码',
            dataIndex: 'fkdj_no',
            itemId: 'fkdj_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '付款冻结原因',
            dataIndex: 'fkdj_reason',
            itemId: 'fkdj_reason',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '标志: 在客户和供应商之间清算?',
            dataIndex: 'sfqs',
            itemId: 'sfqs',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '根据分配号排序代码',
            dataIndex: 'xh',
            itemId: 'xh',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '计划组',
            dataIndex: 'plan_group',
            itemId: 'plan_group',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '检查双重发票或信贷凭单的标志',
            dataIndex: 'scfpzt',
            itemId: 'scfpzt',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '备注',
            dataIndex: 'remarks',
            itemId: 'remarks',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: "物料采购是否需要合同",
            langKey: "sfxyht",
            dataIndex: "sfxyht",
            width: 125,
            mustInput: true,
            lockMustInput: true,
            editor: {
                xtype: "ngComboBox",
                queryMode: "local",
                valueField: "code",
                displayField: "name",
                data: [
                    { "code": "0", "name": "否" },
                    { "code": "1", "name": "是" }
                ],
            }
        },
        {
            header: '供方三包确认反馈时间',
            dataIndex: 'sbfk_dt',
            itemId: 'sbfk_dt',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngDateTime',
                allowBlank: true
            }
        },
        {
            header: '供方三包处理方式',
            dataIndex: 'sbclfs',
            itemId: 'sbclfs',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '分公司',
            dataIndex: 'fgs',
            itemId: 'fgs',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '办事处',
            dataIndex: 'bsc',
            itemId: 'bsc',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        {
            header: '增值税发票限额',
            dataIndex: 'zzsfpxe',
            itemId: 'zzsfpxe',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngNumber',
                allowBlank: true
            }, align: 'right',
            mustInput: false,
            hidden: false,
            renderer: function (val) {
                return Ext.util.Format.number(val, '000,000,000,000.00');
            }
        },
        {
            header: "是否优先付款",
            langKey: "sfysfk",
            dataIndex: "sfysfk",
            width: 125,
            mustInput: true,
            lockMustInput: true,
            editor: {
                xtype: "ngComboBox",
                queryMode: "local",
                valueField: "code",
                displayField: "name",
                data: [
                    { "code": "0", "name": "否" },
                    { "code": "1", "name": "是" }
                ],
            }
        },
        {
            header: '集采标识-预留字段7',
            dataIndex: 'jcylzd',
            itemId: 'jcylzd',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '寄售标识-预留字段8',
            dataIndex: 'jsylzd',
            itemId: 'jsylzd',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '订单结算标识-预留字段9',
            dataIndex: 'ddjsylzd',
            itemId: 'ddjsylzd',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '在供品类',
            dataIndex: 'zgpl',
            itemId: 'zgpl',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '认证业务类别',
            dataIndex: 'rzywlb',
            itemId: 'rzywlb',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '认证产品线',
            dataIndex: 'rzcpx',
            itemId: 'rzcpx',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '供货状态',
            dataIndex: 'gh_stat',
            itemId: 'gh_stat',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '供应商属性',
            dataIndex: 'supply_attribute',
            itemId: 'supply_attribute',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '原厂供应商编码',
            dataIndex: 'ycsupply_no',
            itemId: 'ycsupply_no',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '合作伙伴功能',
            dataIndex: 'partner_gn',
            itemId: 'partner_gn',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '业务合作伙伴计数器',
            dataIndex: 'yw_partner_js',
            itemId: 'yw_partner_js',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '其它供应商参考',
            dataIndex: 'other_supply',
            itemId: 'other_supply',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        }, {
            header: '缺省合作伙伴',
            dataIndex: 'default_partner',
            itemId: 'default_partner',
            readOnly: false,
            mustInput: false,
            width: 100,
            sortable: true,
            locked: false,
            hidden: false,
            editor: {
                xtype: 'ngText',
                allowBlank: true
            }
        },
        ],
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ]
    });
    tabPanel.add(supply_other_info);


}


function getExtendData() {
    ////供应商关联信息
    // var supply_info = Ext.getCmp('supply_info');
    // var extendObj1 = supply_info.getChange(false);

    var supply_other_info = Ext.getCmp('supply_other_info');
    var extendObj2 = supply_other_info.getChange(false);

    //手动建立的表名
    return {
        //     'supply_info': JSON.stringify(extendObj1),
        'supply_other_info': JSON.stringify(extendObj2),
    };

}


